import { observable, action } from "mobx";


 
 
// import{Ajax} from "../component/root.jsx";




export default class Home{

  

  @observable name="首页";

  constructor(args){
    if(args){for(const k in args){this[k] = args[k];}}
    this._init();
  }

  @action set=(k,v)=>{
    const arr = k.split("-");
    const loop = (obj,arr,v)=>{
      const temp = arr.splice(0,1);
      if(arr.length){
        if(!obj[temp]){obj[temp]={};}
        obj = obj[temp];
        loop(obj,arr,v);
      }else{
        obj[temp] = v;
      }
    };
    loop(this,arr,v);
  }
  
 

  _init(){
  }
   

}
